package com.qike.yuandongguoji.enums;

/**
 * 订单状态枚举
 * 订单状态 0未接单 1已接单 2 已完成 3 已取消
 */
public enum OrderStatusEnums {
    UN_TAKE                  (0,"未接单"),
    TAKE                      (1,"已接单"),
    FINISH                     (2,"已完成"),
    CANCELLED                     (3,"已取消"),
    ;
    private Integer ecode;

    private String emsg;

    OrderStatusEnums(Integer ecode, String emsg) {
        this.ecode = ecode;
        this.emsg = emsg;
    }

    public Integer getEcode() {
        return ecode;
    }

    public String getEmsg() {
        return emsg;
    }

    public static OrderStatusEnums statOf(Integer ecode) {
        for (OrderStatusEnums state : values())
            if (state.getEcode().equals(ecode))
                return state;
        return null;
    }
}
